//
//package com.kanjian.music.fragment;
//
//import com.kanjian.music.R;
//import com.kanjian.music.entity.Music;
//import com.kanjian.music.service.PlayerService;
//import com.kanjian.music.util.PlayerUtil;
//
//import android.content.ComponentName;
//import android.content.Context;
//import android.content.Intent;
//import android.content.ServiceConnection;
//import android.os.Bundle;
//import android.os.IBinder;
//import android.support.v4.app.Fragment;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.View.OnClickListener;
//import android.view.ViewGroup;
//import android.widget.Button;
//
//public class RecommendFragment_bak extends Fragment {
//
//    PlayerService mService;
//
//    @Override
//    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//        View rootView = inflater.inflate(R.layout.fragment_recommend, container, false);
//
//        Button btn = (Button) rootView.findViewById(R.id.btn1);
//        btn.setOnClickListener(new OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                Music music = new Music();
//                music.mSonger = "大新鲜乐团";
//                music.mName = "爬梯小姐";
//                music.mLocalPath = "http://music.8508.com/2013_12/116494_1386256378.mp3";
//                PlayerUtil.addMusic(music);
//                music = new Music();
//                music.mSonger = "大新鲜乐团";
//                music.mName = "小丑的眼泪";
//                music.mLocalPath = "http://music.8508.com/2013_12/116494_1386256545.mp3";
//                PlayerUtil.addMusic(music);
//                getActivity().bindService(new Intent(getActivity(), PlayerService.class), conn,
//                        Context.BIND_AUTO_CREATE);
//            }
//        });
//        
//        Button btn2 = (Button) rootView.findViewById(R.id.btn2);
//        btn2.setOnClickListener(new OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                mService.next();
//            }
//        });
//        
//        Button btn3 = (Button) rootView.findViewById(R.id.btn3);
//        btn3.setOnClickListener(new OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                if (mService.isPlaying()) {
//                    mService.pause();
//                } else {
//                    mService.continuePlay();
//                }
//            }
//        });
//
//        return rootView;
//    }
//
//    ServiceConnection conn = new ServiceConnection() {
//
//        @Override
//        public void onServiceConnected(ComponentName name, IBinder service) {
//            mService = ((PlayerService.PlayerServiceBinder) service).getService();
//            mService.play();
//        }
//
//        @Override
//        public void onServiceDisconnected(ComponentName name) {
//
//        }
//    };
//
//}
